package homework02;

public class Movie {
    private String name;//电影名
    private String director;//导演
    private String  protagonist;//主演
    private double  score;//评分
    //无参
    public Movie() {
    }
    //有参
    public Movie(String name, String director, String protagonist, double score) {
        this.name = name;
        this.director = director;
        this.protagonist = protagonist;
        this.score = score;
    }
    //set、get方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDirector() {
        return director;
    }

    public void setDirector(String director) {
        this.director = director;
    }

    public String getProtagonist() {
        return protagonist;
    }

    public void setProtagonist(String protagonist) {
        this.protagonist = protagonist;
    }

    public double getScore() {
        return score;
    }

    public void setScore(double score) {
        this.score = score;
    }
    //重写toString方法

    @Override
    public String toString() {
        return "Movie{" +
                "name='" + name + '\'' +
                ", director='" + director + '\'' +
                ", protagonist='" + protagonist + '\'' +
                ", score=" + score +
                '}';
    }
}
